package com.sendpo.zjx.sendpo.activity;

import android.Manifest;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.ActivityCompat;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Toast;

import com.sendpo.zjx.sendpo.R;
import com.sendpo.zjx.sendpo.application.MyApplication;
import com.sendpo.zjx.sendpo.utils.Tools;

import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by zjx on 2018
 */

public class AboutMyselfActiviy extends AppCompatActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_aboutmyself);
        ButterKnife.bind(this);
        Tools.initStatus(this, R.color.black);
        initComponent();


    }

    private void initComponent() {

    }

    @OnClick(value = {R.id.backbt, R.id.call_iphone})
    public void onMyClick(View view) {
        switch (view.getId()) {
            case R.id.backbt:
                finish();
                break;
            case R.id.call_iphone:
                Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:0755-22932651"));
                if (ActivityCompat.checkSelfPermission(this, Manifest.permission.CALL_PHONE) != PackageManager.PERMISSION_GRANTED) {
                    // TODO: Consider calling
                    //    ActivityCompat#requestPermissions
                    // here to request the missing permissions, and then overriding
                    //   public void onRequestPermissionsResult(int requestCode, String[] permissions,
                    //                                          int[] grantResults)
                    // to handle the case where the user grants the permission. See the documentation
                    // for ActivityCompat#requestPermissions for more details.
                    Toast.makeText(getApplicationContext(),"没有手机拨打权限",Toast.LENGTH_SHORT).show();
                    return;
                }
                startActivity(intent);
                break;

        }
    }
}
